/**给定一个数字，判断是不合适素数
 * @author yuisama
 * @date 2022/03/21 16:15
 **/

import java.util.Scanner;
public class JudgePrime {
    public static void main(String[] args) {
        System.out.println("请输入一个人数字");
        //设置标志额
        boolean isPrime = true;
        Scanner scanner = new Scanner(System.in);
       //多次输入
        while(scanner.hasNextInt()){
            int num =scanner.nextInt();
            for (int i = 2; i <=Math.sqrt(num); i++) {
                if(num % i == 0){
                   isPrime = false;
                    System.out.println(num +"不是素数");
                }
            }
            if(isPrime){
                System.out.println(num + "是素数");
            }
        }
    }
}
